//
//  BKCollectionViewCell.m
//  XPhoto
//
//  Created by baboy on 2019/8/16.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "BKCollectionViewCell.h"

@implementation BKCollectionViewCell
- (void)setCustomContentView:(UIView *)customContentView{
    if (_customContentView == customContentView && self.contentView == [customContentView superview]) {
        [self setNeedsLayout];
        return;
    }
    if (_customContentView && [_customContentView superview]) {
        [_customContentView removeFromSuperview];
    }
    if (customContentView && [customContentView superview] != self.contentView) {
        [customContentView removeFromSuperview];
    }
    _customContentView = customContentView;
    customContentView.frame = self.bounds;
    [self.contentView addSubview:customContentView];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    if (self.customContentView) {
        self.customContentView.frame = self.contentView.bounds;
    }
}
@end
